package com.ytjj.qmyx.mall.service;

import com.alipay.api.request.AlipayMerchantOrderSyncRequest;
import com.alipay.api.request.AlipayTradeOrderinfoSyncRequest;
import com.alipay.api.response.AlipayMerchantOrderSyncResponse;
import com.ytjj.common.model.UsersResponse;
import com.ytjj.qmyx.mall.model.FreightTemplateResponse;
import com.ytjj.qmyx.mall.model.request.AlipayOrderRequest;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;

/**
 * @Description TODO
 *
 * @Version 1.0
 * 
 */
public interface AlipayService {

    /**
     * 手机H5支付 生成预支付订单
     *
     * @param payRequest
     * @return
     */
    String h5PayOrder(AlipayOrderRequest payRequest, HttpServletResponse httpResponse, UsersResponse usersResponse);


    /**
     * 生成预支付订单
     *
     * @param request
     * @return
     */
    String appPayOrder(AlipayOrderRequest request);

    /**
     * 支付宝支付
     * @param params
     * @param tradeType
     * @param childId
     * @return
     */
    String callback(HttpServletRequest params,String tradeType,String childId);

    /**
     * 支付宝h5回调
     *
     * @param request
     * @return
     */
    String h5CallBack(HttpServletRequest request, HttpServletResponse response) throws Exception;

    String quickAppPay(AlipayOrderRequest request);

    Boolean judgeRegionList(FreightTemplateResponse freightTemplateResponse, FreightTemplateResponse chainFreightTemplate, String city);

    /**
     * 组装同步订单状态对象
     * @param orderStatus 订单状态
     * @param orderNo 主订单号
     * @param orderId 主订单id
     * @param userId
     * @return
     */
    AlipayMerchantOrderSyncResponse syncAliPayOrder(String orderStatus, String orderNo, String orderId, Integer userId,
                                                    String productName, Date createTime,String childId,String productImg)throws Exception;

}
